package hello;

import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.bind.annotation.RestController;

import java.util.concurrent.atomic.AtomicLong;


// 使其能处理请求(需要注解其返回对象)
@Controller
public class TestController {


    @RequestMapping("/test")
    @ResponseBody // 响应请求后，将这个类的返回给浏览器，如果是对象 返回json
    public String test(@RequestParam(value="name", defaultValue="Hello World") String name) {
        return name;
    }
}